package kosta.model.board;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

@Service
public class TechTipBoardServiceImpl implements TechTipBoardService{
	@Resource(name="techTipBoardDaoImpl")
	private TechTipBoardDao techTipBoardDao;
	/**
	 * techtip 리스트보기
	 */
	@Override
	public List<BoardVO> getListBoard() throws Exception {
		return techTipBoardDao.getListBoard();
	}
	/**
	 * techtip 글쓰기
	 */
	@Override
	public int insertBoard(BoardVO bvo) throws Exception {
		return  techTipBoardDao.insertBoard(bvo);
	}
	/**
	 * techtip 삭제
	 */
	@Override
	public void deleteBoard(int no,String id) throws Exception {
		System.out.println(no+"-------------service");
		techTipBoardDao.deleteBoard(no);
	}
	/**
	 *techtip 수정
	 */
	@Override
	public int updateBoard(BoardVO bvo) throws Exception {
		return techTipBoardDao.updateBoard(bvo);
	}
	/**
	 *techtip 아이디로 검색
	 */
	@Override
	public List<BoardVO> findById(String id) throws Exception {
		return techTipBoardDao.findById(id);
	}
	/**
	 *techtip 제목으로 검색
	 */
	@Override
	public List<BoardVO> findByTitle(String title) throws Exception {
		return techTipBoardDao.findByTitle(title);
	}
	/**
	 *techtip 카테고리로 검색
	 */
	@Override
	public List<BoardVO> findByCategory(String category) throws Exception {
		return techTipBoardDao.findByCategory(category);
	}
	/**
	 * techtip 상세보기(조회수 증가)
	 */
	@Override
	public BoardVO findByNo(int no) throws Exception {
		techTipBoardDao.updateCount(no);
		return techTipBoardDao.findByNo(no);
	}
	/**
	 *techtip 조회수 증가 안되는것!(글쓰기,수정)
	 */	
	@Override
	public BoardVO findByNoNoHit(int no) throws Exception {		
		return techTipBoardDao.findByNo(no);
	}

}
